Repository navigation
ci(testnet): reproduce the contract state divergence with a dice contract - #93
Merged
Merged
Conversation
…ract Dice reads its own balance and pays 10 CS when it holds at least 20: a node re-executing it while it syncs sees the balance after the same block's payout, throws, keeps a stale state and charges a later payout's fee to the previous player. contracts.py --dice (run.sh CONTRACT_DICE=1) deploys it, funds it, and has two players play it three times in turn before the restart test; its state is compared on every node. Scenario contracts-dice-join (manual): a node syncs from block 0 through the plays. It is expected to fail until contract states are fetched instead of re-executed (step 0 of the contract state sync plan). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 24, 2026
EnzinoBB
added a commit
that referenced
this pull request
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 0 of the contract state sync plan (docs/specs/2026-10-24-contract-state-sync-design.md on docs/contract-state-sync).
Dicereads its own balance and pays 10 CS when it holds at least 20, as the mainnet dice contracts do.contracts.py --dice(run.sh CONTRACT_DICE=1) deploys and funds it, then two players play it three times in turn before the restart test, each play followed by a 10 CS top-up. Its state is compared on every node.Scenario
contracts-dice-join(manual): a node syncs from block 0 through the plays. With today's code it fails as expected (run 40098904794):STATE DIGEST #1000is42668332…on the joining node n8 and72126ED7…on all the others;FAIL: nodes disagree on the Dice state(n825247865…, the others4b0eb779…);state of J3w3e… declared by the block is not available while reading the blockchainlines, one per play.The scenario stays manual until the fix makes it pass; then the flag goes.
🤖 Generated with Claude Code